home *** CD-ROM | disk | FTP | other *** search
- Path: fsgi01.fnal.gov!not-for-mail
- From: b91926@fsgi01.fnal.gov (David Sachs)
- Newsgroups: comp.lang.c++
- Subject: Re: Can you overload a constructor?
- Date: 15 Mar 1996 13:37:43 -0600
- Organization: FERMILAB, Batavia, IL
- Message-ID: <4icgu7$slv@fsgi01.fnal.gov>
- References: <Do859K.K9B@watserv3.uwaterloo.ca>
- Reply-To: sachs@fnal.fnal.gov
- NNTP-Posting-Host: fsgi01.fnal.gov
- X-Newsreader: NN version 6.5.0 #9 (NOV)
-
- jfournie@sciborg.uwaterloo.ca () writes:
-
- >Greetings,
-
- >I am new to C++ and just wanted to make sure it
- >was OK to overload a constructor. gnu c++
- >doesn't have a problem with it, but is it normally
- >done?
-
- It is very normal to overload constructors. In fact
- most classes have at least 2 constructors, a constructor
- to build a class object out of something simpler (often
- nothing - This is called a default constructor), and
- a copy constructor, which makes a duplicate of an existing
- class object. If a class has only a single constructor in
- its declaration, chance are it also has a compiler generated
- copy constructor.
- --
- ***** Listen Americans, the IRS is your taxer, the IRS is one. *****
- David Sachs - Fermilab, HPPC MS369 - P. O. Box 500 - Batavia, IL 60510
- Voice: 1 708 840 3942 Deparment Fax: 1 708 840 3785
-